﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSConsoleTest
{
    class TestJaggedArray : BaseConsoleTest
    {
        public void printDescription()
        {
            Console.WriteLine("--- Jagged array ---");
        }

        public void doTest()
        {
            string[][] jaggedArray = new string[3][];
            jaggedArray[0] = new string[3] { "1-1", "1-2", "1-3" };
            jaggedArray[1] = new string[2] { "2-1", "2-2" };
            jaggedArray[2] = new string[5] { "3-1", "3-2", "3-3", "3-4", "3-5" };
            Console.WriteLine("jaggedArray rank : {0}", jaggedArray.Rank);
            Console.WriteLine("jaggedArray length : {0}", jaggedArray.Length);
            foreach (string[] row in jaggedArray)
            {
                foreach (string value in row)
                {
                    Console.Write("{0} ", value);
                }
                Console.WriteLine();
            }
        }
    }
}
